/* eslint-disable */
/**
 * Created by GYL on 2018/7/25
 */
import React, { Component } from 'react';
import { Tabs, Form, Row, Tooltip, Input, Select, DatePicker, TreeSelect } from 'antd';
import config from '../../../../config';
import Util from '../../../../utils/Util';
import MyTable from "../../../../components/common/MyTable";
import PublicService from "../../../../services/PublicService";
const { TextArea } = Input;
const FormItem = Form.Item;
const { SHOW_CHILD } = TreeSelect;
import request from '../../../../utils/request';
class Tab5 extends Component {
    componentDidMount() {
        request({
            url: '/pm-web/projectmanage/progress/projectSubeventsInfoList',
            method: 'POST',
            data: { eventId: this.props.id }
        }).then(data => {
            // console.log(data)
            if (data.rc === 0) {
                this.setState({
                    dataSate:data.ret
                })

            }
        })
    }

    state = {
        pageSize: 10,
        pageIndex: 1,
        dataSate: []
    }

    onPrint = (record) => {
        console.log(record.subeventsId)
        request({
            url: '/pm-web/projectmanage/progress/projectSubeventsInfo',
            method: 'POST',
            data: { subeventsId	: record.subeventsId }
        }).then(data => {
            console.log(data)
        })
        
    }

    render() {
        const { pageSize, pageIndex, selectedRowKeys, total, dataSate, delConfirm } = this.state
        let { getFieldDecorator } = this.props.form;
        let t = this;
        const columns = [
            { title: '序号', dataIndex: 'num', width: 50 },
            // { title: '文件名', dataIndex: 'projectName', key: 'name', width: 100 },
            // { title: '文件类型', dataIndex: 'projectLeaderId', key: 'platform', width: 100 },
            { title: '子事件名称', dataIndex: 'subeventsName', key: 'subeventsName', width: 100 },
            { title: '权重', dataIndex: 'subeventsWeight', key: 'subeventsWeight', width: 100 },
            { title: '责任部门', dataIndex: 'responsibleDepartmentId', key: 'responsibleDepartmentId', width: 100 },
            { title: '协助部门', dataIndex: 'assDepRoles', key: 'assDepRoles', width: 100 },
            { title: '确认用户', dataIndex: 'confirmUserId', key: 'confirmUserId', width: 100 },
            { title: '完成状态', dataIndex: 'status', key: 'status', width: 100 },
            {
                dataIndex: 'id',
                title: '操作',
                key: 'id9',
                width: 150,
                render: (text, record, index) => {
                    return (
                        <span>
                            {
                                <span>
                                    <a src="javascript:" onClick={this.onPrint.bind(this, record)}>查看</a>
                                </span>
                            }
                        </span>
                    )
                }
            }


        ];
        return (
            <div style={{ height: "45vh", overflow: 'auto' }}>
            
                <MyTable
                    columns={columns}
                    dataSource={PublicService.transformArrayData(dataSate, true, true, pageIndex, pageSize)}
                    pagination={false}
                />
            </div>
        )
    }
}

export default Form.create()(Tab5);
